import { request } from '../../request/index.js'

Page({
  data: {
    keyinput: '',
  },
  onLoad: function () {
  },
  keyInput(e) {
    this.setData({
      keyinput: e.detail.value
    })
  },
  async search() {
    const result = await request({
      url: '/secondhand/goods/search/' + this.data.keyinput,
      // data: this.data.keyinput,
    })
    for (let i = 0; i < result.data.obj.length; i++) {
      result.data.obj[i].imageURL = 'http://47.102.99.215/' + result.data.obj[i].imageURL
    }
    this.setData({
      list: result.data.obj
    })
  },
  //跳转详情
  detail: function (e) {
    let that = this;
    wx.navigateTo({
      url: '/pages/detail/detail?scene=' + e.currentTarget.dataset.id,
    })
  },
})